home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-09 | 6.9 KB | 203 lines | [TEXT/MPS ] |
- #
- # getDefaultStrings
- #
- # Apple Computer, Inc. 1993
- # By Kerry Laidlaw 2/1/93
- #
- # This script will open the "V.DefaultStrings" data file and set
- # shell variables to these string values for use in other scripts.
- #
-
- # Save some initial shell variable values, and set them for our own use
-
- set saveExit {exit}
- set exit 0 # Set exit 0 so we won't abort if status variable is non-zero
- set saveEcho {echo} # echo=1 for echoing each command before execution
- set echo 0
- set saveDir `directory`
-
- if ("{1}" == "setDefaults") || ("{1}" == "doVerify") || ("{1}" == "getDefaults")
- alias > "{mpw}v.TempFile" # Save the current Aliases
- unalias # Delete them because we need to have own set for commando
- # execute v.countryCodes # Establish list of alias' for the countrys
-
- # Country code that is needed for identifying software origin.
- # With new countries just added them in the same format.
-
- #alias ' 0/* - USA' 0
- alias ' 1/F - France' 1
- alias ' 2/B - Britain' 2
- alias ' 3/D - Germany' 3
- alias ' 4/T - Italy' 4
- alias ' 5/N - Netherlands' 5
- alias ' 6/FN - Belgium Lux.' 6
- alias ' 7/S - Sweden' 7
- alias ' 8/E - Spain' 8
- alias ' 9/DK - Denmark' 9
- alias ' 10/PO - Portugal' 10
- alias ' 11/C - Fr. Canadian' 11
- alias ' 12/H - Norway' 12
- alias ' 13/HB - Israel' 13
- alias ' 14/J - Japan' 14
- alias ' 15/X - Australia' 15
- alias ' 16/AB - Arabia' 16
- alias ' 17/K - Finland' 17
- alias ' 18/SF - Fr. Swiss' 18
- alias ' 19/SD - Gr. Swiss' 19
- alias ' 20/GR - Greece' 20
- alias ' 21/IS - Iceland' 21
- alias ' 22/MA - Malta' 22
- alias ' 23/CY - Cyprus' 23
- alias ' 24/TU - Turkey' 24
- alias ' 25/YU - Yugoslavia' 25
- alias ' 33/HN - India' 33
- alias ' 34/UR - Pakistan' 34
- alias ' 36/ST - Italian Swiss' 36
- alias ' 37/Z - International' 37
- alias ' 39/RO - Romania' 39
- #alias ' 40/?? - Polytonic' 40
- alias ' 41/LH - Lithuania' 41
- alias ' 42/PL - Poland' 42
- alias ' 43/MG - Hungary' 43
- alias ' 44/ES - Estonia' 44
- alias ' 45/LT - Latvia' 45
- #alias ' 46/?? - Lapland' 46
- alias ' 47/FA - Faeroe Isl.' 47
- alias ' 48/PS - Iran' 48
- alias ' 49/RS - Russia' 49
- alias ' 50/GE - Ireland' 50
- alias ' 51/KH - Korea' 51
- alias ' 52/CH - China' 52
- alias ' 53/TA - Taiwan' 53
- alias ' 54/TH - Thailand' 54
- alias ' 55/SS - Script System' 55
- alias ' 56/CZ - Czech Republic' 56
- alias ' 57/SL - Slovakia' 57
- alias ' 58/FE - Far East' 58
- alias ' 60/?? - Bangladesh' 60
- alias ' 61/BY - Byelorussia' 61
- alias ' 62/UA - Ukrane' 62
- #alias ' 64/?? - Greece (Alternate)' 64
- alias ' 65/SR - Serbia' 65
- alias ' 66/SV - Slovenia' 66
- alias ' 67/MD - Macedonia' 67
- alias ' 68/CR - Croatia' 68
- alias ' 71/BR - Brazil' 71
- alias ' 72/BG - Bulgaria' 72
- alias ' 73/CA - Catalan' 73
- alias ' 74/ZM - Intl. Multi-Lingual' 74
- alias ' 75/GA - Scotland,Gaelic' 75
- alias ' 76/GV - Man,Gaelic' 76
- alias ' 77/BZ - Breton' 77
- alias ' 78/IK - Canada/Alaska(Inuktitut)' 78
- alias ' 79/SU - Wales' 79
- alias ' 81/GS - Ireland(Gaelic)' 81
- alias ' 82/V - Canada (CanadianEng)' 82
- alias ' 83/BH - Bhutanese' 83
- alias ' 84/HV - Armenian' 84
- alias ' 85/KR - Georgian' 85
- alias ' 86/LA - Latin America' 86
-
- set DefaultStringsFile "{mpw}"scripts:V.DefaultStrings
- target "{DefaultStringsFile}"
-
- # Select line 1 and assign it to my "UserName" shell variable
- find 1
- set UserName "`catenate §`"
- if "{UserName}" == "•No Default•"
- set UserName "{User}"
- end
- export UserName
-
- # Select line 2 and assign it to my "ProductName" shell variable
- find 2
- set ProductName "`catenate §`"
- export ProductName
-
- # Select line 3 and assign it to my "rNamesFolder" shell variable
- find 3
- set rNamesFolder "`catenate §`"
- if (! "`exists -d "{rNamesFolder}"`") && ("{rNamesFolder}" != "•No Default•")
- alert "Could not find rNames folder default:∂n∂n"{rNamesFolder}"∂n∂nThe default has been reset to ∂"•No Default•∂"."
- set rNamesFolder "•No Default•"
- replace 3 "{rNamesFolder}"∂n
- end
- export rNamesFolder
-
- # Select line 4 and assign it to my "MasterFolder" shell variable
- find 4
- set MasterFolder "`catenate §`"
- if (! "`exists -d "{MasterFolder}"`") && ("{MasterFolder}" != "•No Default•")
- alert "Could not find Master folder default:∂n∂n"{MasterFolder}"∂n∂nThe default has been reset to ∂"•No Default•∂"."
- set MasterFolder "•No Default•"
- replace 4 "{MasterFolder}"∂n
- end
- export MasterFolder
-
- # Select line 5 and assign it to my "TestFolder" shell variable
- find 5
- set TestFolder "`catenate §`"
- if (! "`exists -d "{TestFolder}"`") && ("{TestFolder}" != "•No Default•")
- alert "Could not find Test folder default:∂n∂n"{TestFolder}"∂n∂nThe default has been reset to ∂"•No Default•∂"."
- set TestFolder "•No Default•"
- replace 5 "{TestFolder}"∂n
- end
- export TestFolder
-
- # Select line 6 and assign it to my "ReportFolder" shell variable
- find 6
- set ReportFolder "`catenate §`"
- if (! "`exists -d "{ReportFolder}"`") && ("{ReportFolder}" != "•No Default•")
- alert "Could not find Report folder default:∂n∂n"{ReportFolder}"∂n∂nThe default has been reset to ∂"•No Default•∂"."
- set ReportFolder "•No Default•"
- replace 6 "{ReportFolder}"∂n
- end
- export ReportFolder
-
- # Select line 7 and assign it to my "LangCode" shell variable
- find 7
- set countryCodeDefault "`catenate §`"
- export countryCodeDefault
- (evaluate "{countryCodeDefault}" =~ /?(??)®1≈/) >dev:null
- set LangInt "{®1}"
- (evaluate "{countryCodeDefault}" =~ /?(≈)®1/) >dev:null
- alias "∂t{®1}" "{LangInt}" # Set the pop-up default
-
- # Select line 8 and assign it to my "FileList" shell variable
- find 8
- set FileList "`catenate §`"
- if (! "`exists -f "{FileList}"`") && ("{FileList}" != "•No Default•")
- alert "Could not find File List default:∂n∂n"{FileList}"∂n∂nThe default has been reset to ∂"•No Default•∂"."
- set FileList "•No Default•"
- replace 8 "{FileList}"∂n # Write it out to the file
- end
- export FileList
-
- close -y # Save the changes to the default file
- if "{1}" == "doVerify"
- execute v.verify… # Call the Create Report Commando script
- else if "{1}" == "setDefaults"
- execute v.setDefaultStrings…
- else if "{1}" == "getDefaults"
- set rnamesfolder "`directory -q`"
- export rnamesfolder
- execute v.rNames… # Call the Create rNames Commando script
- else
- echo "Script failure - v.getDefaultStrings"
- exit 2
- end
- else
- unalias
- if `exists "{mpw}"v.TempFile`
- execute "{mpw}"v.TempFile
- delete "{mpw}"v.TempFile > dev:null
- end
- end
-
-
- # Restore shell variables and exit
-
- directory "{saveDir}" # Leave the directory setting unchanged
- set echo {saveEcho} # restore echo
- set exit "{saveExit}"
-